#version 310 es
layout(location = 0) in lowp vec3 v_Coord;
layout(location = 1) in lowp vec3 v_Normal;
layout(location = 2) in lowp vec2 v_TexCoord;

uniform mat4 u_Mmatrix;
uniform mat4 u_VPmatrix;
uniform mat3 u_NMmatrix;

out highp vec3 f_Coord;
out highp vec3 f_Normal;
out highp vec2 f_TexCoord;

void main()
{
	f_TexCoord = v_TexCoord;
	f_Normal = normalize(u_NMmatrix * v_Normal);

	f_Coord = vec3(u_Mmatrix * vec4(v_Coord, 1.0));
	gl_Position = u_VPmatrix * vec4(f_Coord, 1.0);
}
